package com.myFirstSpringBootDemo.demo.pojo;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @PropertySource 注解只能扫描properties 文件，不可以扫描yml文件
 */
@PropertySource(value = "classpath:/dongdong.properties")
@Component
@ConfigurationProperties(prefix = "role")
public class Role {

    private String roleName;

    private Integer roleId;

    @Override
    public String toString() {
        return "Role{" +
                "roleName='" + roleName + '\'' +
                ", roleId=" + roleId +
                '}';
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }
}
